package org.geektimes.projects.user.support.mvc;

import org.geekbang.projects.injection.ApplicationContext;
import org.geekbang.projects.injection.processor.ApplicationContextAware;
import org.geektimes.web.mvc.header.WebControllerLoader;

import java.util.List;

/**
* 基于jndi的加载  
* @author : KangNing Hu
*/
public class JNDIWebControllerLoader implements WebControllerLoader , ApplicationContextAware {


	private static ApplicationContext APPLICATION_CONTEXT;

	@Override
	public List<Object> loaders() {
		return APPLICATION_CONTEXT.getBeansByPrefix("web");
	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) {
		APPLICATION_CONTEXT = applicationContext;
	}
}
